<?php

namespace App\Helpers;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\Route;

class Helper
{
    public static function ResourceDescription($name, $contoller, $description)
    {
        $names = Str::plural($name);
        Route::get("/$names", "$contoller@index")->name("$names.index")->description("$description:列表");
        Route::post("/$names", "$contoller@store")->name("$names.store")->description("$description:新增");
        Route::get("/$names/{{$name}}", "$contoller@show")->name("$names.show")->description("$description:详情");
        Route::put("/$names/{{$name}}", "$contoller@update")->name("$names.update")->description("$description:修改");
        Route::delete("/$names/{{$name}}", "$contoller@destroy")->name("$names.destroy")->description("$description:删除");
    }

}
